#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>

int cmp(const void* pa, const void* pb)
{
    return *(int*)pa - *(int*)pb;
}

int majorityElement(int* nums, int numsSize) 
{
    qsort(nums, numsSize, sizeof(int), cmp);
    return nums[numsSize / 2];
}